#include "user.h"

bool User::saveMoney(double value){
	if (value < 0)
		return false;
	_money += value;
	return true;
}

bool User::outMoney(double value){
	if (value < 0 || _money < value)
		return false;
	else
		_money -= value;
	return true;
}

bool operator==(const User& u1, const User &u2){
	return u1.password == u2.password
		&& u1.id == u2.id;
}
